import org.ruslan.text.Highlighter;


public class Main {

	private static final int MAX_SNIPPET_SIZE = 80;

	public static void main(String[] args) {
		long t1 = System.currentTimeMillis();
		String text = "I like fish and pizza. Little star's deep dish pizza sure is fantastic. Dogs are funny.";
		String query = "deep dish pizza";
//		String text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras id erat massa. Ullamcorper Lorem Sed ipsum massa risus massa sed id Lorem, ullamcorper nec sollicitudin id, congue sed tortor. Phasellus sed enim leo. Nullam vehicula varius faucibus. Vestibulum augue mi, adipiscing ac sagittis ut amet.";
//		String query = "lorem sed massa";
		System.out.println("text: " + text);
		System.out.println("query: " + query);
		Highlighter highlighter = new Highlighter(query);
		highlighter.setMaxSnippetSize(MAX_SNIPPET_SIZE);
		highlighter.setTags("<em>", "</em>");
		String highlighted = null;
		for (int i = 0; i < 1; i++) {
			highlighted = highlighter.highlight(text);
		}
		long t2 = System.currentTimeMillis();
		System.out.println("time in millis:" + (t2 - t1));
		
		System.out.println("highlighted: " + highlighted);
	}
}
